// @flow

import React from 'react';
import PropTypes from 'prop-types';

class TableHeader extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        const columns = this.props.columns;
        return (
            <div className="s-bs-table__content__th">
                {
                    columns.map((item, index) => {
                        return (
                            <div style={{ width: item.width }} key={`${item.key}-${index}`} className="s-bs-table__content__td">{item.key}</div>
                        )
                    })
                }

            </div>
        )
    }
}

TableHeader.propTypes = {
    columns: PropTypes.array.isRequired
}

export default TableHeader;
